package com.clz.appdesign.myapp.view;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.RelativeLayout;

import com.clz.appdesign.myapp.R;
import com.clz.appdesign.myapp.view.entiity.Pie;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * @author clz
 */
public class CustomViewActivity extends AppCompatActivity {

    @BindView(R.id.root)
    RelativeLayout mRoot;
    @BindView(R.id.view_trajectory)
    TraJectoryViewByQuadto mViewTrajectory;
    @BindView(R.id.wave_form_view)
    WaveFormView mWaveFormView;
    @BindView(R.id.pie)
    PieView mPie;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_custome_view);
        //PieView view = new PieView(this);
        //setContentView(view);
        ButterKnife.bind(this);
        ArrayList<Pie> datas = new ArrayList<>();
        Pie Pie = new Pie("sloop", 60);
        Pie Pie2 = new Pie("sloop", 30);
        Pie Pie3 = new Pie("sloop", 40);
        Pie Pie4 = new Pie("sloop", 20);
        Pie Pie5 = new Pie("sloop", 20);
        datas.add(Pie);
        datas.add(Pie2);
        datas.add(Pie3);
        datas.add(Pie4);
        datas.add(Pie5);
        mPie.setData(datas);
    }


    @OnClick({R.id.btn_reset, R.id.btn_start_anim})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.btn_reset:
                mViewTrajectory.reset();
                break;
            case R.id.btn_start_anim:
                mWaveFormView.startAnim();
                break;
            default:
                break;
        }
    }
}
